﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin_Finan_AddT.aspx.cs"
    Inherits="Web.admin_Finan_AddT" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>记账凭证</title>

    <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>

 <link href="css/Page.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        window.onload=function(){
            var dTwo = document.getElementById("ddlBankType");
            var dBank=document.getElementById("ddlBankType");

            var Tseven=document.getElementById("txtRemark");
            var dFour=document.getElementById("ddlItemType");
            var Ttext=document.getElementById("jieF");
            var Dtext=document.getElementById("daiF");
            
            var sSix=document.getElementById("ddlDepartTyle");
           var Time=document.getElementById("DoDataTime");
           var btn=document.getElementById("btn_save");
            document.body.onkeydown=function(e){
                e=e||window.event;
                var keyCode = e.keyCode||e.which;
                if(keyCode==13){
                    if(document.activeElement.id=="ddlRecodeTyle"){
                    
                     var ddl_value=document.getElementById("ddlRecodeTyle").value;
                     if(ddl_value==-1)
                     {
                     alert("请选择日记账类型！");
                     document.getElementById("ddlRecodeTyle").focus();
                     return false;
                     
                     }
                    else
                    {
                     Tseven.focus();
                     return false;
                     }
                    }
                    if(document.activeElement.id=="ddlBankType")
                    {
                    
                    var ddl_bank_value=document.getElementById("ddlBankType").value;
                    if(ddl_bank_value==-1)
                    {
                    alert("请选择银行类型！");
                     document.getElementById("ddlBankType").focus();
                    }else
                    {
                    
                    Tseven.focus();
                    return false;
                    }
                    }
                    if(document.activeElement.id=="txtRemark"){
                    
                      if(document.getElementById("txtRemark").value.length==0)
                      {
                      alert("请填写摘要内容！");
                      document.getElementById("txtRemark").focus();
                      }else
                      {
                        dFour.focus();
                        return false;
                        }
                    }
                   
                   
                    if(document.activeElement.id=="ddlItemType")
                    {
                    if(document.getElementById("ddlItemType").value==-1)
                    {
                    alert("请选择科目类别！");
                    document.getElementById("ddlItemType").focus();
                    return false;
                    }else
                    {
                    Ttext.focus();
                    return false;
                    }
                    }
                   if(document.activeElement.id=="jieF")
                   {
                   
                     if(isNaN( document.getElementById("jieF").value)){
                          alert("请输金额数字！ 例如：1000");
                          Ttext.focus();
                           return false;
                        } 
                   
                   if(document.getElementById("jieF").value.length>0)
                   {
                   
                    document.getElementById("daiF").value="";
                    sSix.focus();
                    return false;
                   }else
                   {
                   Dtext.focus();
                   return false;
                   }
                   }
                   if(document.activeElement.id=="daiF")
                   {
                   
                    if(isNaN( document.getElementById("daiF").value)){
                          alert("请输金额数字！ 例如：1000");
                          Dtext.focus();
                           return false;
                        } 
                   
                     if(document.getElementById("daiF").value.length>0)
                     {
                     
                      document.getElementById("jieF").value="";
                      sSix.focus();
                      return false;
                      }
                   }
                   if(document.activeElement.id=="ddlDepartTyle")
                   {
                   
                   if(document.getElementById("ddlDepartTyle").value==-1)
                   {
                     alert("请选择部门类型！");
                     document.getElementById("ddlDepartTyle").focus();
                     return false;
                   }
                   
                   Time.focus();
                   return false;
                   }
                  
                }
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="border: 1px solid #9abddd;" border="0" cellpadding="0"
            cellspacing="0" width="98%">
            <tr>
                <td colspan="7" class="TitleBar" align="center">
                    记账凭证
                </td>
            </tr>
            <tr>
                <td class="MenuItem" style="text-align: center;">
                    日记账类型
                </td>
                <td class="MenuItem" style="text-align: center;">
                    摘&nbsp;&nbsp;&nbsp;&nbsp;要
                </td>
                <td class="MenuItem" style="text-align: center;">
                    科目名称
                </td>
                <td class="MenuItem" style="text-align: center;">
                    借(收)方金额
                </td>
                <td class="MenuItem" style="text-align: center;">
                    贷(支)方金额
                </td>
                <td class="MenuItem" style="text-align: center;">
                    部门
                </td>
                <td class="MenuItem" style="text-align: center;">
                    制单日期
                </td>
            </tr>
            <tr style="height: 60px;">
                <td class="ItemName" style="text-align: center;">
                    <asp:DropDownList ID="ddlRecodeTyle" runat="server" TabIndex="1" Width="100px" AutoPostBack="true" style=" margin-left:10px;"
                        OnSelectedIndexChanged="ddlRecodeTyle_SelectedIndexChanged">
                        <asp:ListItem Value="-1" Selected="True">请选择</asp:ListItem>
                        <asp:ListItem Value="1">现金日记账</asp:ListItem>
                        <asp:ListItem Value="2">银行日记账</asp:ListItem>
                    </asp:DropDownList>
                    <br />
                    <asp:DropDownList ID="ddlBankType" runat="server" TabIndex="2" Width="100px" style=" margin-left:10px;">
                    </asp:DropDownList>
                </td>
                <td class="ItemName" style="text-align: center;">
                    <textarea id="txtRemark" name="S1" runat="server" style="width: 200px; height: 40px;margin-left:30px;"></textarea>
                </td>
                <td class="ItemName" style="text-align: center;">
                    <asp:DropDownList ID="ddlItemType" runat="server" TabIndex="5" style=" margin-left:10px;">
                    </asp:DropDownList>
                </td>
                <td class="ItemName" style="text-align: center;">
                    <input type="text" id="jieF" runat="server"  style=" margin-left:30px;" />
                </td>
                <td class="ItemName" style="text-align: center;">
                    <input type="text" id="daiF" runat="server" style=" margin-left:30px;" />
                </td>
                <td class="ItemName" style="text-align: center;">
                    <asp:DropDownList ID="ddlDepartTyle" runat="server" TabIndex="7" 
                        onselectedindexchanged="ddlDepartTyle_SelectedIndexChanged" AutoPostBack="true">
                    </asp:DropDownList>
                    <br />
                    
                      <asp:DropDownList ID="ddlemploy" runat="server" TabIndex="8" Width="100px" style=" margin-left:10px;">
                    </asp:DropDownList>
                    
                </td>
                <td class="ItemName" style="text-align: center;">
                    <asp:TextBox ID="DoDataTime" runat="server" onclick="new WdatePicker({dateFmt:'yyyy-MM-dd'});"
                        Width="70px" TabIndex="6"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="center" class="Pager" colspan="7">
                    <asp:Button ID="btn_save" runat="server" TabIndex="9" OnClick="btn_save_Click" Text="保存添加" />
                    <asp:Button ID="btn_new" runat="server" Text="添加新凭证" onclick="btn_new_Click" />
                    <asp:Button ID="btn_back" runat="server" TabIndex="10" Text="返回列表" OnClick="btn_back_Click" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
